package com.lucker.ds.model;

import java.util.Date;

/**
 * sys_restrictions_config
 * @author 
 */
public class SysRestrictionsConfig extends BaseValueObject {
    private Long id;

    /**
     * 限制
     */
    private Integer restrictions;

    /**
     * 名称
     */
    private String name;

    /**
     * 类型
     */
    private String type;

    /**
     * 赋值
     */
    private Integer experience;

    /**
     * 0禁用1使用
     */
    private Integer status;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 修改时间
     */
    private Date updateTime;

    /**
     * 真实名称用于后台管理界面维护显示的标题
     */
    private String realName;

    private String customQuerySqlText = null;

    private String orderStr = null;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getRestrictions() {
        return restrictions;
    }

    public void setRestrictions(Integer restrictions) {
        this.restrictions = restrictions;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Integer getExperience() {
        return experience;
    }

    public void setExperience(Integer experience) {
        this.experience = experience;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public void setCustomQuerySqlText(String customQuerySqlText) {
        this.customQuerySqlText = customQuerySqlText;
    }

    public String getCustomQuerySqlText() {
        return customQuerySqlText;
    }

    public void orderById(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by id asc";
            }else{
                this.orderStr = this.orderStr + ",id asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by id desc";
            }else{
                this.orderStr = this.orderStr + ",id desc";
            }
        }
    }

    public void orderByRestrictions(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by restrictions asc";
            }else{
                this.orderStr = this.orderStr + ",restrictions asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by restrictions desc";
            }else{
                this.orderStr = this.orderStr + ",restrictions desc";
            }
        }
    }

    public void orderByName(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by name asc";
            }else{
                this.orderStr = this.orderStr + ",name asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by name desc";
            }else{
                this.orderStr = this.orderStr + ",name desc";
            }
        }
    }

    public void orderByType(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by type asc";
            }else{
                this.orderStr = this.orderStr + ",type asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by type desc";
            }else{
                this.orderStr = this.orderStr + ",type desc";
            }
        }
    }

    public void orderByExperience(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by experience asc";
            }else{
                this.orderStr = this.orderStr + ",experience asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by experience desc";
            }else{
                this.orderStr = this.orderStr + ",experience desc";
            }
        }
    }

    public void orderByStatus(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by status asc";
            }else{
                this.orderStr = this.orderStr + ",status asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by status desc";
            }else{
                this.orderStr = this.orderStr + ",status desc";
            }
        }
    }

    public void orderByCreateTime(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by create_time asc";
            }else{
                this.orderStr = this.orderStr + ",create_time asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by create_time desc";
            }else{
                this.orderStr = this.orderStr + ",create_time desc";
            }
        }
    }

    public void orderByUpdateTime(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by update_time asc";
            }else{
                this.orderStr = this.orderStr + ",update_time asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by update_time desc";
            }else{
                this.orderStr = this.orderStr + ",update_time desc";
            }
        }
    }

    public void orderByRealName(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by real_name asc";
            }else{
                this.orderStr = this.orderStr + ",real_name asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by real_name desc";
            }else{
                this.orderStr = this.orderStr + ",real_name desc";
            }
        }
    }
}